We've moved! — MindVault360 is now HexLab. Better design, more content & premium notes.

Visit HexLab →

MindVault360 has moved!

We've upgraded to HexLab — a faster, more professional platform with better content, premium notes, and a modern design.

Visit us at hexlab

Saturday, August 31, 2024

Life cycle of a thread

 (Tap the post to see more)


Life cycle of a thread

A thread goes through various stages in its lifecycle.  The following diagram shows the complete life cycle of a thread.

 


Following are the stages of the life cycle −

New − A new thread begins its life cycle in the new state. It remains in this state until the program starts the thread. It is also referred to as a born thread.

Runnable − After a newly born thread is started, the thread becomes runnable. A thread in this state is considered to be executing its task.

 Waiting − Sometimes, a thread transitions to the waiting state while the thread waits for another thread to perform a task. Thread transitions back to the runnable state only when another thread signals the waiting thread to continue executing.

Terminated (Dead) − A runnable thread enters the terminated state when it completes its task or otherwise terminates.

← Back Next →

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home